//
//  GCMenuSlefMessageViewController.m
//  GoldChampion
//
//  Created by Mac on 2018/4/12.
//  Copyright © 2018年 stoneobs@icloud.com. All rights reserved.
//


#import "TMCoversationListViewController.h"
#import "TMCoversationDetailViewController.h"
@interface TMCoversationListViewController ()

@end

@implementation TMCoversationListViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.title = @"消息";
    [self configSubView];
    // Do any additional setup after loading the view.
}

#pragma mark --subView
- (void)configSubView{
    self.conversationListTableView.contentInset = UIEdgeInsetsZero;
    self.conversationListTableView.frame = CGRectMake(0, 0, UIScreenWidth, [TMUtils tabBarTop] + 49 -[TMUtils navgationBarBootom]);
    self.emptyConversationView = [[STNoresultView alloc] initWithFrame:CGRectMake(0, 100, UIScreenWidth, 400) title:@"暂无消息" buttonTitle:@"" buttonHandle:^(NSString *titleString) {
        
    }];
    self.conversationListTableView.separatorStyle = UITableViewCellSeparatorStyleNone;
    self.conversationListTableView.contentInset = UIEdgeInsetsZero;
    CGRect frame = CGRectMake(0, 0, UIScreenWidth, [TMUtils tabBarTop] + 49 -[TMUtils navgationBarBootom]);
    self.automaticallyAdjustsScrollViewInsets = NO;
    UIView * footer = [[UIView alloc] initWithFrame:CGRectMake(0, 0, UIScreenWidth, 0.01)];
    self.conversationListTableView.tableFooterView = footer;
    if (ios11 && [self.conversationListTableView respondsToSelector:@selector(setContentInsetAdjustmentBehavior:)]) {
        [self.conversationListTableView setContentInsetAdjustmentBehavior:@(2)];
    }
}
- (void)onSelectedTableRow:(RCConversationModelType)conversationModelType
         conversationModel:(RCConversationModel *)model
               atIndexPath:(NSIndexPath *)indexPath{
    TMCoversationDetailViewController * vc = [[TMCoversationDetailViewController alloc] initWithConversationType:model.conversationType targetId:model.targetId];    
    [self.navigationController pushViewController:vc animated:YES];
}
@end
